package com.example.javabasic.thread.classone.templatemode;

/**
 * 模板模式
 * 资料地址: https://www.bilibili.com/video/BV1L4411i7eW?p=4
 */
public abstract class TemplateModeDemo {

    public void print(String s){
        wrapPrint(s);
    }

    abstract void wrapPrint(String message);


    public static void main(String[] args) {
        TemplateModeDemo demo = new TemplateModeDemo() {
            @Override
            void wrapPrint(String message) {
                System.out.println("hello "+message);
            }
        };
        demo.print("world");
    }




}
